package com.lx.boot.web.convert.deserializer;

import com.fasterxml.jackson.annotation.JacksonAnnotationsInside;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.lx.annotation.Note;
import com.lx.boot.web.convert.DFunction;

import java.lang.annotation.*;

import static java.lang.annotation.ElementType.*;

@Inherited
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD,ElementType.TYPE,ElementType.PARAMETER})
@Documented
@JacksonAnnotationsInside
@JsonDeserialize(using = DeserializeHandler.class)
@Note("处理json反序列化, 入参时转换")
public @interface Deserialize {
    @Note("根据函数获取返回值! 示例:")
    Class<? extends Annotation> value() default Deserialize.class;

    @Note("根据函数获取返回值! 示例:")
    Class<? extends DFunction<DeserializerPara,? extends Annotation, Object>> function();

    String[] other() default {};
    //@JsonAlias({"t2","t"}) 可以为参数指定别名
    //@JsonProperty 序列化和反序列化时修改字段名
}